[PWGJE] pTHat handling, remove HepMCXSections dependency, add R-d…#15284
[PWGJE] pTHat handling, remove HepMCXSections dependency, add R-d…#15284joonsukbae wants to merge 2 commits intoAliceO2Group:masterfrom
Conversation
3e8d5b5 to
7ebc7cc
Compare
…ependent matching - trackEfficiency: Remove HepMCXSections and JMcCollisionPIs table subscriptions from all MC processes; use ptHard() from JMcCollisions with weight-based fallback. Add applyRCTSelections configurable. - jetSpectraCharged: Pass pTHat as parameter to fill functions instead of computing internally; fix pTHatMaxMCD->pTHatMaxMCP bug in fillGeoMatchedAreaSubHistograms; change MCD weighted process subscriptions to JetCollisionsMCD for mcCollision() access. - All jet matching tasks: Replace single maxMatchingDistance with per-R configurables (jetRadiiForMatchingDistance + maxMatchingDistancePerJetR) for R-dependent geometric matching distance. Applied to jetMatchingMC, jetMatchingMCSub, jetMatchingSub, jetMatchingDuplicates, jetSubstructureMatching, and jetSubstructureMatchingSub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7ebc7cc to
35b52a7
Compare
nzardosh
left a comment
There was a problem hiding this comment.
Thanks for the PR Joonsuk. Please make the changes and then locally test that you get the same results.
Also in the future if you would like to make changes to the core tasks, please discuss them in advance first
Thanks
PWGJE/Core/JetMatchingUtilities.h
Outdated
| } | ||
| std::tie(baseToTagMatchingGeoIndex, tagToBaseMatchingGeoIndex) = MatchJetsGeometrically(jetsBasePhi, jetsBaseEta, jetsTagPhi, jetsTagEta, maxMatchingDistance); // change max distnace to a function call | ||
| float effectiveMatchingDistance = maxMatchingDistance; | ||
| for (std::size_t i = 0; i < jetRadiiForMatchingDistance.size() && i < maxMatchingDistancePerJetR.size(); i++) { |
There was a problem hiding this comment.
here i would only check one of i < jetRadiiForMatchingDistance.size() or i < maxMatchingDistancePerJetR.size() since we constrain them to be the same
PWGJE/Core/JetMatchingUtilities.h
Outdated
| jetsTagGlobalIndex.emplace_back(jetTag.globalIndex()); | ||
| } | ||
| std::tie(baseToTagMatchingGeoIndex, tagToBaseMatchingGeoIndex) = MatchJetsGeometrically(jetsBasePhi, jetsBaseEta, jetsTagPhi, jetsTagEta, maxMatchingDistance); // change max distnace to a function call | ||
| float effectiveMatchingDistance = maxMatchingDistance; |
There was a problem hiding this comment.
here take the first one in the list so we can get rid of maxMatchingDistance as variable. So do
float effectiveMatchingDistance = maxMatchingDistance[0];
There was a problem hiding this comment.
it will break if an empty list is given at runtime but i think thats good. or where you do the LOGP fatal you can also check that the lists are not empty
| } | ||
|
|
||
| template <typename T, typename U> | ||
| void MatchGeo(T const& jetsBasePerCollision, U const& jetsTagPerCollision, std::vector<std::vector<int>>& baseToTagMatchingGeo, std::vector<std::vector<int>>& tagToBaseMatchingGeo, float maxMatchingDistance) |
There was a problem hiding this comment.
remove the variable float maxMatchingDistance,
| @@ -35,6 +35,8 @@ struct JetMatchingDuplicates { | |||
| o2::framework::Configurable<bool> doMatchingPt{"doMatchingPt", true, "Enable pt matching"}; | |||
| o2::framework::Configurable<bool> doMatchingHf{"doMatchingHf", false, "Enable HF matching"}; | |||
| o2::framework::Configurable<float> maxMatchingDistance{"maxMatchingDistance", 0.24f, "Max matching distance"}; | |||
There was a problem hiding this comment.
remove this variable everywhere
| o2::framework::Configurable<bool> doMatchingHf{"doMatchingHf", false, "Enable HF matching"}; | ||
| o2::framework::Configurable<float> maxMatchingDistance{"maxMatchingDistance", 0.24f, "Max matching distance"}; | ||
| o2::framework::Configurable<std::vector<double>> jetRadiiForMatchingDistance{"jetRadiiForMatchingDistance", {}, "Jet R values for per-R matching distance override, e.g. {0.2, 0.4, 0.6}"}; | ||
| o2::framework::Configurable<std::vector<double>> maxMatchingDistancePerJetR{"maxMatchingDistancePerJetR", {}, "Max matching distance for each R in jetRadiiForMatchingDistance, e.g. {0.12, 0.24, 0.36}"}; |
There was a problem hiding this comment.
have you checked up in previous analysis notes that these are the correct default values? Please also find the appropriate ones for R=0.3 and R=0.5 and add them too
PWGJE/Core/JetMatchingUtilities.h
Outdated
| } | ||
| std::tie(baseToTagMatchingGeoIndex, tagToBaseMatchingGeoIndex) = MatchJetsGeometrically(jetsBasePhi, jetsBaseEta, jetsTagPhi, jetsTagEta, maxMatchingDistance); // change max distnace to a function call | ||
| float effectiveMatchingDistance = maxMatchingDistance; | ||
| for (std::size_t i = 0; i < jetRadiiForMatchingDistance.size() && i < maxMatchingDistancePerJetR.size(); i++) { |
There was a problem hiding this comment.
this whole addition could be moved to line 314, after these :
for (auto jetR : jetsR) {
std::vector jetsBasePhi;
std::vector jetsBaseEta;
std::vector jetsBaseGlobalIndex;
std::vector baseToTagMatchingGeoIndex;
std::vector tagToBaseMatchingGeoIndex;
Because that way then you evaluate it once per jetR and you dont have to do the evaluation each time per jet
PWGJE/Core/JetMatchingUtilities.h
Outdated
|
|
||
| template <typename T, typename U> | ||
| void MatchGeo(T const& jetsBasePerCollision, U const& jetsTagPerCollision, std::vector<std::vector<int>>& baseToTagMatchingGeo, std::vector<std::vector<int>>& tagToBaseMatchingGeo, float maxMatchingDistance) | ||
| void MatchGeo(T const& jetsBasePerCollision, U const& jetsTagPerCollision, std::vector<std::vector<int>>& baseToTagMatchingGeo, std::vector<std::vector<int>>& tagToBaseMatchingGeo, float maxMatchingDistance, std::vector<double> const& jetRadiiForMatchingDistance = {}, std::vector<double> const& maxMatchingDistancePerJetR = {}) |
There was a problem hiding this comment.
you dont need to initialise with empty vectors. Its good to make sure these vectors are always given to the function and no default empty value is taken
- Remove maxMatchingDistance from all headers and JetMatchingUtilities.h
- Non-empty defaults: {0.3, 0.4, 0.5} -> {0.18, 0.24, 0.30}
- init() fatal on empty/mismatched vectors
- Runtime fatal if jet R not in configured list
- Per-R lookup once per R, not per jet
- No default empty vectors in function signatures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dear Nima,
Tested locally: ran full pipeline (jet finding + matching + trackEfficiency + jetSpectraCharged) on LHC25a2. All 125 Understood — I'll discuss changes to core tasks in advance before making edits. Thanks for the guidance. |
…ependent matching
HepMCXSections/JMcCollisionPIstable subscriptions from all MC processes. UseptHard()fromJMcCollisionswith weight-based fallback. AddapplyRCTSelectionsconfigurable. RemovegetPtHatFromHepMCXSectionconfigurable.pTHatMaxMCD→pTHatMaxMCPbug. Change MCD weighted subscriptions toJetCollisionsMCD. AddapplyRCTSelectionsconfigurable.JetMatchingUtilities.h): Add per-R matching distance override (jetRadiiForMatchingDistance+maxMatchingDistancePerJetR) on top of existingmaxMatchingDistancefallback. Backward compatible — empty per-R vectors (default) give identical results.